package com.bignerdranch.android.ecar.Fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bignerdranch.android.ecar.Activity.BlogActivity;
import com.bignerdranch.android.ecar.Activity.NewsListActivity;
import com.bignerdranch.android.ecar.R;

/**
 * Created by Administrator on 2016/7/18.
 */
public class FoundFragment extends Fragment implements View.OnClickListener {
    private TextView num_90;
    private TextView num_93;
    private TextView num_97;
    private TextView num_0;
    private RelativeLayout part_1;
    private RelativeLayout part_2;
    private RelativeLayout part_3;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_found, container, false);

        initView(view);
        return view;
    }

    private void initView(View view) {
        num_90 = (TextView) view.findViewById(R.id.num_90);
        num_93 = (TextView) view.findViewById(R.id.num_93);
        num_97 = (TextView) view.findViewById(R.id.num_97);
        num_0 = (TextView) view.findViewById(R.id.num_0);
        part_1 = (RelativeLayout) view.findViewById(R.id.part_1);
        part_1.setOnClickListener(this);
        part_2 = (RelativeLayout) view.findViewById(R.id.part_2);
        part_2.setOnClickListener(this);
        part_3 = (RelativeLayout) view.findViewById(R.id.part_3);
        part_3.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.part_1:
                Intent intent1 = new Intent(getActivity(), BlogActivity.class);
                startActivity(intent1);
                break;
            case R.id.part_2:
                break;
            case R.id.part_3:
                Intent intent = new Intent(getActivity(), NewsListActivity.class);
                startActivity(intent);
                break;
        }
    }
}
